import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    title: '网页的页签栏标题',
    home: Scaffold(
      // 顶部操作栏
      appBar: AppBar(
        title: Text('标题'),
        backgroundColor: Colors.pink,
      ),
      // 配出正文主题部分
      body: Main(),
    ),
  ));
}

class Main extends StatelessWidget {
  const Main({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
        padding: EdgeInsets.all(5),
        // 1. 使用build构造函数
        child: GridView.builder(
          gridDelegate:
              SliverGridDelegateWithMaxCrossAxisExtent(maxCrossAxisExtent: 100,mainAxisSpacing: 10, crossAxisSpacing: 10),
              
          itemBuilder: (BuildContext context, int index) {
            return Container(
              child: Text('A$index'),
              color: Colors.amber,
            );
          },
        ));
  }
}
